<template>
  <el-main>
    <el-form ref="form" :model="form"   label-width="80px">
      <el-form-item label="楼盘名称" prop="name">
        <el-input v-model="form.name" placeholder="楼盘名称" />
      </el-form-item>
      <el-form-item label="楼盘地址" prop="address">
        <el-input v-model="form.address" placeholder="楼盘地址" />
      </el-form-item>
      <el-form-item label="城市地区" prop="address">
        省<el-select></el-select>
        市<el-select></el-select>
        区<el-select></el-select>
      </el-form-item>
      <el-form-item label="建筑面积" prop="proportion">
        <el-input v-model="form.proportion" placeholder="建筑面积"/>
      </el-form-item>
      <el-form-item label="建筑类型" prop="buildingType">
        <el-checkbox>板楼</el-checkbox>
        <el-checkbox>塔楼</el-checkbox>
        <el-checkbox>板塔结合</el-checkbox>
        <el-checkbox>底层</el-checkbox>
        <el-checkbox>多层</el-checkbox>
        <el-checkbox>高层</el-checkbox>
      </el-form-item>
      <el-form-item label="社区类型" prop="premisesType">
        <el-select
          v-model="form.communityType"
          placeholder="社区类型"
          clearable
          size="small"
          style="width: 240px"
        >
          <el-option
            v-for="dict in communityTypes"
            :key="dict.dictValue"
            :label="dict.dictLabel"
            :value="dict.dictValue"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="物业类型" prop="premisesType">
        <el-checkbox>普通住宅</el-checkbox>
        <el-checkbox>公寓</el-checkbox>
        <el-checkbox>商住两用</el-checkbox>
        <el-checkbox>商业地产</el-checkbox>
        <el-checkbox>写字楼</el-checkbox>
      </el-form-item>
      <el-form-item label="楼盘特色" prop="">
        <el-checkbox>品牌企业</el-checkbox>
        <el-checkbox>科技住宅</el-checkbox>
        <el-checkbox>核心地段</el-checkbox>
        <el-checkbox>精装修</el-checkbox>
        <el-checkbox>地铁沿线</el-checkbox>
        <el-checkbox>低总价</el-checkbox>
        <el-checkbox>学区房</el-checkbox>
        <el-checkbox>小户型</el-checkbox>
        <el-checkbox>改善型住宅</el-checkbox>
        <el-checkbox>宜居社区</el-checkbox>
        <el-checkbox>跃层</el-checkbox>
        <el-checkbox>高层</el-checkbox>
      </el-form-item>

      <el-form-item label="容积率" prop="grossPlotRatio">
        <el-input v-model="form.grossPlotRatio" placeholder="容积率"/>
      </el-form-item>
      <el-form-item label="得房率" prop="efficiency">
        <el-input v-model="form.efficiency" placeholder="得房率"/>
      </el-form-item>
      <el-form-item label="绿化率" prop="greenCoverage">
        <el-input v-model="form.greenCoverage" placeholder="绿化率"/>
      </el-form-item>
      <el-form-item label="楼栋数" prop="buildingCount">
        <el-input v-model="form.buildingCount" placeholder="楼栋数"/>
      </el-form-item>
      <el-form-item label="开发商" prop="developer">
        <el-input v-model="form.developer" placeholder="开发商"/>
      </el-form-item>
      <el-form-item label="物业管理公司" prop="estate">
        <el-input v-model="form.estate" placeholder="物业管理公司"/>
      </el-form-item>
      <el-form-item label="楼盘简介" prop="introduce">
        <el-input v-model="form.introduce" placeholder="楼盘简介"/>
      </el-form-item>
      <el-form-item label="楼盘简介" prop="introduce">
        <el-input v-model="form.introduce" placeholder="楼盘简介"/>
      </el-form-item>
      <el-form-item label="周边配套" prop="">
        <el-button @click="">添加</el-button>
        <el-button @click="">删除</el-button>
      </el-form-item>
      <el-form-item label="交通情况" prop="">
        <el-button @click="">添加</el-button>
        <el-button @click="">删除</el-button>
      </el-form-item>




    </el-form>
      <el-button type="primary" @click="submitForm">提交</el-button>
  </el-main>
</template>

<script>
import { addPremises} from "@/api/premises/info";
  export default {
    name: "save",
    data(){
      return{
        // 表单参数
        form: {},
        communityTypes:[]
      }
    },
    methods:{
      submitForm:function (){
        addPremises(this.form).then(Response=>{
          alert("成功");
          this.$router.push("index")
        })
      }
    },
    created() {
      this.getDicts("communityType").then(response => {
        this.communityTypes = response.data;
      });
    },

  }
</script>

<style scoped>

</style>
